
public class Main {

    public static void print32(int num) {
        //
        for (int i = 31; i >= 0; i--) {
            //   &    1  1  -> 1
            System.out.print((num & (1 << i)) == 0 ? "0" : "1"); //左移    确定 这个 num的32进制
        }
        System.out.println();

    }

    public static void main(String[] args) {

        int num = 845741347;
        // 打印32进制  32 位
        print32(num);

        int test = 1;
        print32(test << 1);
        print32(test << 2);
        print32(test << 8);

        int o = Integer.MAX_VALUE;
        System.out.println(o);
        int i = Integer.MIN_VALUE;
        System.out.println(i);

        int b = 1235151;
        int c = ~b;
        System.out.println("b :" + b + "\t" + "c :" + c);

        print32(-5);

        print32(b);
        print32(c);

        System.out.println("============");

        int a = 342515315;
        int l = 1753032;
        print32(a | l);
        print32(a ^ l);
        print32(a & l);

        int a1 = 1024;
        print32(a1);
        print32(a1 >> 1);

        int t = 6;
        int d = t;
        d = (~t + 1);
        print32(d);

    }
}
